#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define maxsize 30
typedef struct Wroot
{
    int count;
    char word[maxsize];
    struct Wroot *left;
    struct Wroot *right;
} * root, node;

void insert(root &wordTree, const char *word)
{
    if (wordTree == NULL)
    {
        wordTree = (root)malloc(sizeof(node));
        wordTree->left = wordTree->right = NULL;
        wordTree->count = 1;
        strcpy(wordTree->word, word);
    }
    else
    {
        if (strcmp(wordTree->word, word) < 0)
        {
            insert(wordTree->left, word);
        }
        else if (strcmp(wordTree->word, word) > 0)
        {
            insert(wordTree->right, word);
        }
        else
        {
            wordTree->count++;
        }
    }
}

int main()
{

    root word_tree = NULL;
    insert(word_tree, "abc");
    insert(word_tree, "ab");
    insert(word_tree, "abcd");
    insert(word_tree, "abc");
    return 0;
}